#define THIS_FILE "assassiner.sqf"
#include <base\tmf_constants.h>
#include <base\tmf_macros.h>
WAITINIT(assassiner);

// ["C_man_1_1_F","marker1"] execVM "assassiner.sqf";
if (!isServer) exitWith {};
private ["_type","_marker","_killed","_error","_obj_params","_obj_params","_killed_msg"];
DEFAULT_PARAM(_type,0,"");
DEFAULT_PARAM(_marker,1,"");
DEFAULT_PARAM(_killed,2,"");
DEFAULT_PARAM(_killed_msg,3,ARR_2("STR_TYR_TARGET_ASSASSINATED",(ARR_1(_type) call CFUNC(displayName))));

_error = false;
if (IS_STRING(_type)) then { _error = (_type == "") };
if (IS_STRING(_marker)) then { _error = (_marker == "") };
if (_error) exitWith {};

_obj_params = [];
_obj_params set [TMF_VEH_PARAMS_TYPE, _type];
_obj_params set [TMF_VEH_PARAMS_GRP, GVAR(enemy_side)];
_obj_params set [TMF_VEH_PARAMS_POS, _marker];

_tmf_params = [];
_tmf_params = [_tmf_params,"KILLED_MSG",_killed_msg] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"SHARED_VAR",_killed] call CFUNC(hashSet);
// _tmf_params = [_tmf_params,"KILLED_CODE",""] call CFUNC(hashSet);

OBJ = [_obj_params,"ASSASSINATE",_tmf_params] call FFUNC(CreateMissionUnit);